// Reminder.h: interface for the CReminder class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_REMINDER_H__1C519676_70E8_41D7_8636_47BF0EDFC342__INCLUDED_)
#define AFX_REMINDER_H__1C519676_70E8_41D7_8636_47BF0EDFC342__INCLUDED_

#include "IniFile.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define KEY_REM "REM"


#define FNR_MAX 20

#define COLORCASH_ENABLE	2
#define COLORCASH_DISABLE	1
#define COLORCASH_NOTSET	0


#define REMINDER_FILE "Reminder.ini"



class CReminder  
{
public:
	class CDayColorCash
	{	public:
		int isSet[12][31];
		COLORREF BG[12][31];
		COLORREF FG[12][31];
		BOOL isBG[12][31];
		BOOL isMark[12][31];

		void Clear()
		{	int i,j;
			for(i=0;i<31;i++) for(j=0;j<12;j++) isSet[j][i]=COLORCASH_NOTSET;
		}
		CDayColorCash()	{ Clear();}
		void SetEnable(CTime T,COLORREF cBG,COLORREF cFG,BOOL cisBG,BOOL cisMark)
		{	int D=T.GetDay()-1;
			int M=T.GetMonth()-1;
			isSet[M][D]=COLORCASH_ENABLE;
			BG[M][D]=cBG;
			FG[M][D]=cFG;
			isBG[M][D]=cisBG;
			isMark[M][D]=cisMark;
		}
		void SetDisable(CTime T)
		{	int D=T.GetDay()-1;
			int M=T.GetMonth()-1;
			isSet[M][D]=COLORCASH_DISABLE;
		}
		BOOL Get(CTime T,COLORREF* pBG,COLORREF* pFG,BOOL* pisBG,BOOL* pisMark)
		{	int D=T.GetDay()-1;
			int M=T.GetMonth()-1;
			if (isSet[M][D]==COLORCASH_ENABLE)
			{	*pBG=BG[M][D];
				*pFG=FG[M][D];
				*pisBG=isBG[M][D];
				*pisMark=isMark[M][D];
			}
			return isSet[M][D];
		}
	};
	CDayColorCash m_ColorCash;
	void SetRed(CString FileName);
	BOOL isRed(CString FileName);
	CString m_FNRed[FNR_MAX];
	BOOL GetDayColors(CTime T,COLORREF *pBG, COLORREF *pFG,BOOL* pisBG,BOOL* pisMark);
	void INI_Drop();
	BOOL IsShow(CString Key,CTime T,COLORREF* pBG,COLORREF* pFG,BOOL* pisBG,BOOL* pisMark,CString* pSTR,BOOL isCalendar=FALSE);
	void INI_Read(CString FileName);
	CIniFile m_ini;
	CString m_AppPath;
	CString m_FileName;
	CReminder();
	virtual ~CReminder();

};

#endif // !defined(AFX_REMINDER_H__1C519676_70E8_41D7_8636_47BF0EDFC342__INCLUDED_)
